package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcClassSchedual;
import com.visizen.wisdomclass.server.model.WcClassSchedualExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcClassSchedualMapper {
    @SelectProvider(type=WcClassSchedualSqlProvider.class, method="countByExample")
    int countByExample(WcClassSchedualExample example);

    @DeleteProvider(type=WcClassSchedualSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcClassSchedualExample example);

    @Delete({
        "delete from wc_class_schedual",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long ID);

    @Insert({
        "insert into wc_class_schedual (ID, CLASS_ID, ",
        "TITILE, CONTENT, ",
        "ARRA_TIME)",
        "values (#{ID,jdbcType=BIGINT}, #{CLASS_ID,jdbcType=BIGINT}, ",
        "#{TITILE,jdbcType=VARCHAR}, #{CONTENT,jdbcType=VARCHAR}, ",
        "#{ARRA_TIME,jdbcType=TIMESTAMP})"
    })
    int insert(WcClassSchedual record);

    @InsertProvider(type=WcClassSchedualSqlProvider.class, method="insertSelective")
    int insertSelective(WcClassSchedual record);

    @SelectProvider(type=WcClassSchedualSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="CLASS_ID", property="CLASS_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="TITILE", property="TITILE", jdbcType=JdbcType.VARCHAR),
        @Result(column="CONTENT", property="CONTENT", jdbcType=JdbcType.VARCHAR),
        @Result(column="ARRA_TIME", property="ARRA_TIME", jdbcType=JdbcType.TIMESTAMP)
    })
    List<WcClassSchedual> selectByExample(WcClassSchedualExample example);

    @Select({
        "select",
        "ID, CLASS_ID, TITILE, CONTENT, ARRA_TIME",
        "from wc_class_schedual",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="CLASS_ID", property="CLASS_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="TITILE", property="TITILE", jdbcType=JdbcType.VARCHAR),
        @Result(column="CONTENT", property="CONTENT", jdbcType=JdbcType.VARCHAR),
        @Result(column="ARRA_TIME", property="ARRA_TIME", jdbcType=JdbcType.TIMESTAMP)
    })
    WcClassSchedual selectByPrimaryKey(Long ID);

    @UpdateProvider(type=WcClassSchedualSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcClassSchedual record, @Param("example") WcClassSchedualExample example);

    @UpdateProvider(type=WcClassSchedualSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcClassSchedual record, @Param("example") WcClassSchedualExample example);

    @UpdateProvider(type=WcClassSchedualSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcClassSchedual record);

    @Update({
        "update wc_class_schedual",
        "set CLASS_ID = #{CLASS_ID,jdbcType=BIGINT},",
          "TITILE = #{TITILE,jdbcType=VARCHAR},",
          "CONTENT = #{CONTENT,jdbcType=VARCHAR},",
          "ARRA_TIME = #{ARRA_TIME,jdbcType=TIMESTAMP}",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcClassSchedual record);
}